package com.onpositive.knowledge.model.values;

import java.util.ArrayList;
import java.util.List;

import org.omg.DynamicAny.DynAnyPackage.InvalidValueHelper;

import com.onpositive.knowledge.model.IUniverse;
import com.onpositive.semantic.model.api.property.IProperty;

public class CompositeTransformer implements IValueTransformer  {


	/**
	 * 
	 */
	private static final long serialVersionUID = 598163272326263817L;
	public static final String ID = "composite-transformer";
	ArrayList<IValueTransformer> vls = new ArrayList<IValueTransformer>();

	public boolean add(IValueTransformer e) {
		return vls.add(e);
	}

	public List<IValueTransformer> getTransformers() {
		return vls;
	}

	public boolean remove(IValueTransformer o) {
		return vls.remove(o);
	}

	@Override
	public DescribedValue[] adjust(Object object, IProperty prop,
			DescribedValue... original) {
		for (IValueTransformer t : vls) {
			original = t.adjust(object, prop, original);
		}
		return original;
	}

	@Override
	public String getId() {
		return ID;
	}
}
